colorswatch: Update to new GtkGestureSingle/GtkEventController defaults
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 11 Aug 2014 19:48:43 +0000 (21:48 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 15 Aug 2014 11:49:40 +0000 (13:49 +0200)
GtkGestureSingle::button is set to 0 on the multipress gesture, as several
buttons are managed by that gesture. Also avoid some extra lines of code
setting what nowadays are default values.

https://bugzilla.gnome.org/show_bug.cgi?id=734285

gtk/gtkcolorswatch.c

index 7af895661b87841bc2e4d49aa825064f7662fbae..503d8f734bfe5068d75efa7d79b083229ab29a0f 100644 (file)
@@ -89,17 +89,15 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
   gtk_widget_set_has_window (GTK_WIDGET (swatch), FALSE);
 
   swatch->priv->long_press_gesture = gtk_gesture_long_press_new (GTK_WIDGET (swatch));
+  gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->long_press_gesture),
+                                     TRUE);
   g_signal_connect (swatch->priv->long_press_gesture, "pressed",
                     G_CALLBACK (hold_action), swatch);
-  gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->long_press_gesture),
-                                              GTK_PHASE_BUBBLE);
 
   swatch->priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (swatch));
-  gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), FALSE);
+  gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (swatch->priv->multipress_gesture), 0);
   g_signal_connect (swatch->priv->multipress_gesture, "pressed",
                     G_CALLBACK (tap_action), swatch);
-  gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (swatch->priv->multipress_gesture),
-                                              GTK_PHASE_BUBBLE);
 }
 
 #define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11)